import Vue from 'vue'
import App from '../App'
import Router from 'vue-router'

import Car from '@/page/car/index'
import Trade from '@/page/my/order/index'
import Fincance from '@/page/fincance'
Vue.use(Router)
/*const city = r => require.ensure([], () => r(require('../page/city/city')), 'city')*/
export default new Router({
  mode: 'history',
  routes: [
    {path: '/',name:'/',component:() => import('@/page/home/index')},
    {path:'/custom',name:'myCustom',component :() => import('@/page/custom/index')},
    {path:'/fincance',name:'Fincance',component :Fincance,
      children:[
        {path:'list',name:'list',component:()=>import('@/page/fincance/list')},
        {path:'edit',name:'myedit',component:()=>import('@/page/fincance/edit')}
      ]},
    {path:'/cloud',component :() => import('@/page/cloud/index')},
    {path:'/my',component :() => import('@/page/my/index')},
    {path:'/cart',component :() => import('@/page/cart/index')},
    {path:'/car',name:'Car',component :Car,
      children:[
        {path:'list',name:'ListCar',component:()=>import('@/page/car/listCar')},
        {path:'detail/:id',name:'DetailCar',component:()=>import('@/page/car/CarDetail')},
      ]
    },
    {path:'/trade',name:'trade',component :Trade,
      children:[
        {path:'all',component:()=>import('@/page/my/order/allOrders')},
        {path:'lc',component:()=>import('@/page/my/order/lc')},
        {path:'tax',component:()=>import('@/page/my/order/tax')},
        {path:'negotiation',component:()=>import('@/page/my/order/negotiation')},
        {path:'detail',component:()=>import('@/page/my/order/detailOrder')},
      ]
    },
    {path:'/search',name:'Search',component :() => import('@/page/search/index')},
    {path:'/submitOrder',name:'Search',component :() => import('@/page/submit_order/index')}
  ]
});
